export function formatNumber (num) {
	return num >= 10 ? num : `0${num}`
}

// 获取当前年份
export function currentYear () {
	const date = new Date()
	const year = date.getFullYear()
	return year
}

// 获取当前日期
export function currentDate () {
	const date = new Date()
	const year = date.getFullYear()
	const month = date.getMonth() + 1
	const day = date.getDate()
	return `${formatNumber(year)}.${formatNumber(month)}.${formatNumber(day)}`
}

// 获取当前时间
export function currentTime () {
	const date = new Date()
	const hour = formatNumber(date.getHours())
	const miuntes = formatNumber(date.getMinutes())
	const seconds = formatNumber(date.getSeconds())
	return `${hour}:${miuntes}:${seconds}`
}

// 数字转为星期
export function numberToWeekStr (week) {
	const list = ['一', '二', '三', '四', '五', '六', '日']
	return list[week-1]
}